package cn.echoidea.app;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.nutz.json.Json;
import org.nutz.json.JsonFormat;
import org.nutz.lang.Times;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;

@At({ "/hello" })
public class HelloNutz {
	@At({ "/a" })
	@Ok("jsp")
	public String a() {

		return "中国人";
	}

	@At({ "/vidsk" })
	@Ok("jsp")
	public String ok(HttpServletRequest request) {

		Map<String, String[]> parameterMap = request.getParameterMap();

		String json = Json.toJson(parameterMap, JsonFormat.nice());

		BlogModel obj = new BlogModel();
		obj.setContent(json);
		obj.setTitle(Times.sDTms(Times.now()));
		Root.dao.insert(obj);
		return "done";
	}
}